package com.vanzo.encryption;

/**
 * Created by dingo on 03/02/2018.
 */

public class Pdt {

    public static int MAX_BUFFER_LEN = 1024;

    public native String stringFromJNI();

    public static native int test(int a, int b);

    public static native int getGroupKey(byte[] gk, Integer iLen);

    public static native int getKillKey(byte[] gk, Integer iLen);

    public static native int systemCommand(byte[] inValue, byte[] outValue, Integer outLen);

    public static native int getSuperkey2NFC(int groupId, int terminalId, int firstId, int totalTerminalSize, int channelId, int isLocked, byte[] gk, byte[] kk, byte[] value, Integer iLen);

    public static native int parseSuperkeyFromNFC(byte[] value, Integer iLen, Integer groupId, Integer terminalId, Integer totalTerminalSize, Integer firstId, Integer channelId, Integer isLocked, byte[] outValue, Integer outLen);

    public static native int getDeviceStatus(byte[] outValue, Integer outLength);

    public static native int getLastCmdResult(byte[] outValue, Integer outLength);

    public static native int sendKillMessage(int groupId, int terminalId, byte[] kk, byte[] outValue, Integer outLength);

    public static native int sendMessage(int groupId, int terminalId, byte[] msg, byte[] outValue, Integer outLength);

    public static native int parseBinary(byte[] binary, int binaryLength, byte[] type, Short outLength, byte[] value);

    // Used to load the 'native-lib' library on application startup.
    static {
        System.loadLibrary("crypdt");
        System.loadLibrary("native-lib");
    }
}
